#!/bin/sh

# Usage:
#		test_certs {cert_file} {private_key_file}
# Example:
#		test_certs aps_developer_indetity.cer aps_developer_identity.p12

mkdir -p priv/temp
openssl pkcs12 -in "$2" -out priv/temp/key-enc.pem -nodes
openssl rsa -in priv/temp/key-enc.pem -out priv/temp/key.pem
openssl x509 -inform der -in "$1" -out priv/temp/cert.pem
cat priv/temp/cert.pem priv/temp/key.pem > priv/cert.pem
rm -rf priv/temp
make tests
